<template>
  <div class="register" :style="{ height: pageHeight + 'px' }">
    <!-- 动态背景效果 -->
    <div class="cyber-bg">
      <div class="grid-overlay"></div>
      <div class="star-field"></div>
      <div class="digital-rain"></div>
      <div class="light-beam light-beam-1"></div>
      <div class="light-beam light-beam-2"></div>
    </div>

    <!-- 科技装饰 -->
    <div class="tech-effects">
      <div class="orbit orbit-1"></div>
      <div class="orbit orbit-2"></div>
      <div class="orbit orbit-3"></div>
    </div>

    <div class="register__container">
      <div class="register__card">
        <!-- 卡片装饰 -->
        <div class="card-ornaments">
          <div class="corner corner-tl"></div>
          <div class="corner corner-tr"></div>
          <div class="corner corner-bl"></div>
          <div class="corner corner-br"></div>
          <div class="hex-pattern"></div>
          <div class="circuit-lines"></div>
        </div>

        <div class="register__header">
          <div class="logo-container">
            <div class="logo-background"></div>
            <img src="../assets/yike.svg" class="logo" alt="Logo">
            <div class="logo-glow"></div>
            <div class="logo-ring"></div>
          </div>
          <h1 class="title">CYBER<span class="highlight">注册</span></h1>
          <p class="subtitle">接入系统，畅游数字新世界</p>
        </div>

        <div class="register__form">
          <div class="form-container">
            <yk-form ref="formRef" :rules="rules" :model="user">
              <yk-form-item field="name">
                <div class="input-wrapper">
                  <i class="icon user-icon"></i>
                  <yk-input v-model="user.name" placeholder="用户名"></yk-input>
                  <div class="input-glow"></div>
                  <div class="input-scan"></div>
                </div>
              </yk-form-item>
              <yk-form-item field="psw">
                <div class="input-wrapper">
                  <i class="icon lock-icon"></i>
                  <yk-input v-model="user.psw" placeholder="密码" type="password"></yk-input>
                  <div class="input-glow"></div>
                  <div class="input-scan"></div>
                </div>
              </yk-form-item>
            </yk-form>

            <button class="register-btn" @click="submit">
              <span class="btn-text">激活账号</span>
              <span class="btn-effect"></span>
            </button>

            <div class="login-link">
              已有账号？<a @click="goToLogin">立即登录</a>
            </div>
          </div>
        </div>

        <div class="register__footer">
          <div class="cyber-seal"></div>
          <p>注册即表示您同意我们的<a href="#">服务条款</a>和<a href="#">隐私政策</a></p>
        </div>
      </div>
    </div>

    <!-- 浮动元素 -->
    <div class="floating-elements">
      <div class="element el-1">01</div>
      <div class="element el-2">10</div>
      <div class="element el-3">アニメ</div>
      <div class="element el-4">サイバー</div>
      <div class="element el-5">デジタル</div>
      <div class="element el-6">⧉</div>
      <div class="element el-7">⌬</div>
      <div class="element el-8">⏣</div>
      <div class="element el-9">⏥</div>
      <div class="element el-10">⌘</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, getCurrentInstance, useTemplateRef, onMounted } from 'vue';
import type { FormInstance } from '@yike-design/ui/es/components/form'
import { registerAPI } from '@/api';
import { useCode } from '@/hooks/code';
const { tackleCode } = useCode();

const formRef = useTemplateRef<FormInstance>('formRef')
const proxy: any = getCurrentInstance()?.proxy;

const pageHeight = ref(window.innerHeight);

// 用户
const user = ref({
  name: '',
  psw: ''
});

const rules = {
  name: [
    { required: true, message: '请输入用户名', trigger: 'blur' },
    { minLength: 4, maxLength: 16, message: '用户名长度必须在4-16个字符之间', trigger: 'blur' }
  ],
  psw: [
    { required: true, message: '请输入密码', trigger: 'blur' },
    { minLength: 6, maxLength: 20, message: '密码长度必须在6-20个字符之间', trigger: 'blur' }
  ]
}

// 调整窗口大小时更新高度
onMounted(() => {
  window.addEventListener('resize', () => {
    pageHeight.value = window.innerHeight;
  });

  // 为数字雨添加动画
  initDigitalRain();
});

// 初始化数字雨动画
const initDigitalRain = () => {
  const columns = document.querySelectorAll('.rain-column');
  columns.forEach((column, index) => {
    const chars = generateRandomChars(20 + Math.random() * 30);
    (column as HTMLElement).innerHTML = chars;
    (column as HTMLElement).style.animationDelay = `${index * 0.5}s`;
    (column as HTMLElement).style.left = `${index * 10}%`;
  });
}

// 生成随机字符
const generateRandomChars = (length: any) => {
  const chars = '01アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン';
  let result = '';
  for (let i = 0; i < length; i++) {
    result += `<span style="animation-delay: ${i * 0.1}s">${chars[Math.floor(Math.random() * chars.length)]}</span><br>`;
  }
  return result;
}

// 提交
const submit = async () => {
  const valid = await formRef.value?.validate();
  if (valid) {
    return
  } {
    const data = {
      name: user.value.name,
      password: user.value.psw,
      moment: new Date()
    }
    const res: any = await registerAPI(data);
    console.log(res);
    if (tackleCode(res.code)) {
      // 注册成功
      proxy.$message({
        type: 'success',
        message: '注册成功！'
      });
      // 重定向到首页或其他页面
      proxy.$router.push({ path: '/login' });
    } else {
      // 注册失败
      proxy.$message({
        type: 'error',
        message: res.message || '注册失败，请稍后再试。',
      });
      return;
    }
  }
};

// 跳转到登录页
const goToLogin = () => {
  proxy.$router.push({ path: '/login' });
};
</script>

<style lang="less" scoped>
.register {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0b17 0%, #1a1b3a 100%);
  color: #e4f3ff;
  font-family: 'Noto Sans', 'Noto Sans SC', sans-serif;

  // 动态背景效果
  .cyber-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;

    .grid-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image: linear-gradient(#0e4166 1px, transparent 1px),
        linear-gradient(90deg, #0e4166 1px, transparent 1px);
      background-size: 40px 40px;
      opacity: 0.15;
      perspective: 1000px;
      transform-style: preserve-3d;
      transform: rotateX(60deg) scale(2.5);
      animation: grid-move 20s linear infinite;
      z-index: 1;
    }

    .star-field {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image:
        radial-gradient(2px 2px at 20px 30px, #eef 100%, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff 100%, transparent),
        radial-gradient(1px 1px at 90px 40px, #fff 100%, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff 100%, transparent),
        radial-gradient(1px 1px at 160px 120px, #fff 100%, transparent);
      background-repeat: repeat;
      background-size: 200px 200px;
      opacity: 0.3;
      animation: stars-move 100s linear infinite;
    }

    .digital-rain {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><text x="10" y="15" fill="%2300FFAA" font-family="monospace" font-size="10">10100110</text><text x="50" y="35" fill="%2300FFAA" font-family="monospace" font-size="10">01101001</text><text x="90" y="55" fill="%2300FFAA" font-family="monospace" font-size="10">11001010</text><text x="30" y="75" fill="%2300FFAA" font-family="monospace" font-size="10">00110101</text><text x="70" y="95" fill="%2300FFAA" font-family="monospace" font-size="10">10101100</text></svg>');
      background-repeat: repeat;
      opacity: 0.1;
      animation: rain-fall 20s linear infinite;
    }

    .light-beam {
      position: absolute;
      width: 100px;
      height: 1200px;
      background: linear-gradient(to bottom,
          rgba(0, 247, 255, 0) 0%,
          rgba(0, 247, 255, 0.1) 15%,
          rgba(0, 247, 255, 0.3) 50%,
          rgba(0, 247, 255, 0.1) 85%,
          rgba(0, 247, 255, 0) 100%);
      opacity: 0.05;
      transform: rotate(-45deg);
      filter: blur(5px);

      &-1 {
        top: -300px;
        left: 20%;
        animation: beam-move 8s infinite alternate ease-in-out;
      }

      &-2 {
        top: -400px;
        right: 15%;
        animation: beam-move 12s infinite alternate-reverse ease-in-out;
      }
    }
  }

  // 科技效果装饰
  .tech-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;

    .orbit {
      position: absolute;
      border-radius: 50%;
      border: 1px dashed rgba(0, 195, 255, 0.2);
      animation: orbit-rotate infinite linear;

      &-1 {
        top: 20%;
        right: 10%;
        width: 300px;
        height: 300px;
        animation-duration: 30s;
      }

      &-2 {
        bottom: 10%;
        left: 15%;
        width: 250px;
        height: 250px;
        border-color: rgba(255, 0, 230, 0.15);
        animation-duration: 20s;
      }

      &-3 {
        top: 50%;
        left: 50%;
        width: 400px;
        height: 400px;
        transform: translate(-50%, -50%);
        border-color: rgba(0, 255, 140, 0.15);
        animation-duration: 40s;
      }

      &:before {
        content: '';
        position: absolute;
        width: 10px;
        height: 10px;
        background: #00c3ff;
        border-radius: 50%;
        box-shadow: 0 0 10px 2px #00c3ff;
      }

      &-1:before {
        top: 5%;
        left: 50%;
        background: #00c3ff;
      }

      &-2:before {
        top: 50%;
        left: 90%;
        background: #ff00e6;
        box-shadow: 0 0 10px 2px #ff00e6;
      }

      &-3:before {
        top: 75%;
        left: 25%;
        background: #00ff8c;
        box-shadow: 0 0 10px 2px #00ff8c;
      }
    }
  }

  &__container {
    width: 100%;
    max-width: 480px;
    z-index: 10;
    position: relative;
  }

  &__card {
    position: relative;
    background: rgba(16, 23, 41, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 40px;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(0, 195, 255, 0.2),
      inset 0 0 20px rgba(0, 195, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: center;
    overflow: hidden;

    // 卡片装饰
    .card-ornaments {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      overflow: hidden;

      .corner {
        position: absolute;
        width: 30px;
        height: 30px;
        opacity: 0.8;

        &-tl {
          top: 0;
          left: 0;
          border-top: 2px solid #00c3ff;
          border-left: 2px solid #00c3ff;
        }

        &-tr {
          top: 0;
          right: 0;
          border-top: 2px solid #00c3ff;
          border-right: 2px solid #00c3ff;
        }

        &-bl {
          bottom: 0;
          left: 0;
          border-bottom: 2px solid #00c3ff;
          border-left: 2px solid #00c3ff;
        }

        &-br {
          bottom: 0;
          right: 0;
          border-bottom: 2px solid #00c3ff;
          border-right: 2px solid #00c3ff;
        }
      }

      .hex-pattern {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><path d="M30,10 L45,20 L45,40 L30,50 L15,40 L15,20 Z" stroke="rgba(0,195,255,0.1)" fill="none" stroke-width="1"/></svg>');
        background-size: 60px 60px;
        opacity: 0.3;
      }

      .circuit-lines {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M30,10 Q40,40 70,50 T90,90" stroke="rgba(0,255,170,0.1)" fill="none" stroke-width="1" stroke-linecap="round"/></svg>');
        opacity: 0.2;
      }
    }

    &:before {
      content: '';
      position: absolute;
      top: -3px;
      left: 20%;
      width: 60%;
      height: 3px;
      background: linear-gradient(to right,
          rgba(0, 195, 255, 0),
          rgba(0, 195, 255, 1),
          rgba(0, 195, 255, 0));
      animation: scan-line 4s infinite ease-in-out;
    }

    &:after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(135deg,
          rgba(255, 255, 255, 0.05) 0%,
          rgba(255, 255, 255, 0) 20%,
          rgba(255, 255, 255, 0) 80%,
          rgba(255, 255, 255, 0.05) 100%);
      pointer-events: none;
    }

    &:hover {
      transform: translateY(-5px);
      box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 195, 255, 0.08);
    }
  }

  &__header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;

    .logo-container {
      position: relative;
      width: 100px;
      height: 100px;
      margin: 0 auto 30px;

      .logo-background {
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: rgba(6, 23, 44, 0.6);
        box-shadow:
          0 0 20px rgba(0, 195, 255, 0.3),
          inset 0 0 15px rgba(0, 195, 255, 0.3);
      }

      .logo {
        width: 70%;
        height: 70%;
        object-fit: contain;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
        filter: drop-shadow(0 0 8px rgba(0, 195, 255, 0.8));
      }

      .logo-glow {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 150%;
        height: 150%;
        transform: translate(-50%, -50%);
        background: radial-gradient(circle at center,
            rgba(0, 195, 255, 0.3) 0%,
            rgba(0, 195, 255, 0) 70%);
        animation: pulse 4s infinite alternate ease-in-out;
      }

      .logo-ring {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 120%;
        height: 120%;
        transform: translate(-50%, -50%);
        border: 1px solid rgba(0, 195, 255, 0.3);
        border-radius: 50%;
        animation: ring-rotate 10s linear infinite;

        &:before {
          content: '';
          position: absolute;
          top: -2px;
          left: 50%;
          width: 4px;
          height: 4px;
          background: #00c3ff;
          border-radius: 50%;
          box-shadow: 0 0 10px #00c3ff;
        }
      }
    }

    .title {
      font-size: 42px;
      font-weight: 700;
      color: #fff;
      margin-bottom: 10px;
      letter-spacing: 3px;
      text-shadow: 0 0 10px rgba(0, 195, 255, 0.5);

      .highlight {
        position: relative;
        color: #00ffea;
        font-family: 'Noto Sans SC', sans-serif;

        &:after {
          content: '';
          position: absolute;
          bottom: -3px;
          left: 0;
          width: 100%;
          height: 2px;
          background: linear-gradient(to right,
              rgba(0, 195, 255, 0),
              rgba(0, 255, 234, 1),
              rgba(0, 195, 255, 0));
        }
      }
    }

    .subtitle {
      color: rgba(255, 255, 255, 0.7);
      font-size: 16px;
      font-weight: 300;
      letter-spacing: 1px;
      text-shadow: 0 0 5px rgba(0, 195, 255, 0.3);
    }
  }

  &__form {
    margin-bottom: 36px;
    position: relative;
    z-index: 2;

    .form-container {
      width: 100%;
      max-width: 340px;
      margin: 0 auto;
    }

    :deep(.yk-form) {
      width: 100%;
    }

    :deep(.yk-form-item) {
      margin-bottom: 24px;
    }

    .input-wrapper {
      position: relative;
      width: 100%;
      margin-bottom: 8px;

      .icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        z-index: 3;
        opacity: 0.7;
        transition: all 0.3s;
      }

      :deep(.yk-input) {
        width: 286px;
        height: 54px;
        border: 1px solid rgba(0, 195, 255, 0.3);
        background: rgba(6, 23, 44, 0.5);
        color: #fff;
        padding: 8px 16px 8px 48px;
        border-radius: 8px;
        font-size: 16px;
        transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
        font-family: 'Noto Sans', 'Noto Sans SC', sans-serif;
        letter-spacing: 1px;
        box-shadow:
          0 2px 10px rgba(0, 0, 0, 0.2),
          inset 0 0 8px rgba(0, 195, 255, 0.1);

        &:focus,
        &:hover {
          border-color: rgba(0, 255, 234, 0.6);
          background: rgba(6, 23, 44, 0.6);
          box-shadow:
            0 0 15px rgba(0, 195, 255, 0.15),
            inset 0 0 10px rgba(0, 195, 255, 0.15);
        }

        &::placeholder {
          color: rgba(255, 255, 255, 0.4);
          font-style: normal;
        }
      }

      // 输入框扫描效果
      .input-scan {
        position: absolute;
        top: 0;
        left: -10%;
        width: 10%;
        height: 100%;
        background: linear-gradient(to right,
            rgba(0, 255, 234, 0) 0%,
            rgba(0, 255, 234, 0.2) 50%,
            rgba(0, 255, 234, 0) 100%);
        animation: input-scan 3s infinite ease-in-out;
      }

      // 输入框辉光
      .input-glow {
        position: absolute;
        bottom: -2px;
        left: 10%;
        width: 80%;
        height: 2px;
        background: #00ffea;
        opacity: 0;
        transition: opacity 0.3s, transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
        transform: scaleX(0);
        transform-origin: center;
      }

      &:hover .input-glow,
      :deep(.yk-input:focus)~.input-glow {
        opacity: 1;
        transform: scaleX(1);
      }

      &:hover .icon,
      :deep(.yk-input:focus)~.icon {
        opacity: 1;
        color: #00ffea;
      }
    }

    .register-btn {
      margin-top: 36px;
      width: 100%;
      height: 54px;
      font-size: 18px;
      font-weight: bold;
      background: linear-gradient(90deg, #0077B6, #00B4D8);
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
      position: relative;
      font-family: 'Noto Sans', 'Noto Sans SC', sans-serif;
      letter-spacing: 2px;
      overflow: hidden;
      box-shadow:
        0 4px 12px rgba(0, 123, 182, 0.5),
        inset 0 0 0 1px rgba(0, 195, 255, 0.2);

      .btn-effect {
        position: absolute;
        top: -100%;
        left: -100%;
        width: 300%;
        height: 300%;
        background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0) 100%);
        transform: rotate(45deg);
        transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
        animation: btn-shine 4s infinite linear;
      }

      &:hover {
        background: linear-gradient(90deg, #0096c7, #00d4ff);
        transform: translateY(-3px);
        box-shadow:
          0 10px 20px rgba(0, 123, 182, 0.6),
          inset 0 0 0 1px rgba(0, 195, 255, 0.4);
      }

      &:active {
        transform: translateY(1px);
        box-shadow:
          0 5px 10px rgba(0, 123, 182, 0.4),
          inset 0 0 0 1px rgba(0, 195, 255, 0.2);
      }

      .btn-text {
        position: relative;
        z-index: 2;
      }
    }

    .login-link {
      text-align: center;
      margin-top: 24px;
      color: rgba(255, 255, 255, 0.6);
      font-size: 15px;

      a {
        color: #00ffea;
        text-decoration: none;
        cursor: pointer;
        transition: all 0.3s;
        position: relative;
        font-weight: 500;
        padding: 0 3px;

        &:after {
          content: '';
          position: absolute;
          bottom: -2px;
          left: 0;
          width: 100%;
          height: 1px;
          background: #00ffea;
          transform: scaleX(0);
          transform-origin: right;
          transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        }

        &:hover {
          color: #5dffff;
          text-shadow: 0 0 5px rgba(0, 255, 234, 0.5);

          &:after {
            transform: scaleX(1);
            transform-origin: left;
          }
        }
      }
    }
  }

  &__footer {
    position: relative;
    z-index: 2;
    margin-top: 30px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);

    .cyber-seal {
      position: absolute;
      bottom: -30px;
      right: -10px;
      width: 80px;
      height: 80px;
      background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="rgba(0,195,255,0.2)" stroke-width="1"/><circle cx="50" cy="50" r="30" fill="none" stroke="rgba(0,195,255,0.2)" stroke-width="1"/><path d="M50,5 L50,95 M5,50 L95,50 M20,20 L80,80 M20,80 L80,20" stroke="rgba(0,195,255,0.2)" fill="none" stroke-width="1"/></svg>') no-repeat center center;
      opacity: 0.6;
      animation: seal-rotate 20s infinite linear;
    }

    a {
      color: rgba(255, 255, 255, 0.5);
      text-decoration: none;
      transition: all 0.3s;
      border-bottom: 1px dotted rgba(0, 195, 255, 0.3);
      padding-bottom: 1px;

      &:hover {
        color: #00ffea;
        border-color: #00ffea;
      }
    }
  }

  // 浮动元素
  .floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;

    .element {
      position: absolute;
      font-family: 'Noto Sans JP', 'Noto Sans', monospace;
      color: rgba(0, 255, 234, 0.2);
      animation: float-animation infinite linear;
      opacity: 0;
      text-shadow: 0 0 5px rgba(0, 255, 234, 0.3);

      &.el-1 {
        top: -50px;
        left: 10%;
        font-size: 30px;
        animation-duration: 15s;
        animation-delay: 0s;
      }

      &.el-2 {
        top: -50px;
        left: 20%;
        font-size: 26px;
        animation-duration: 12s;
        animation-delay: 2s;
      }

      &.el-3 {
        top: -50px;
        left: 35%;
        font-size: 22px;
        animation-duration: 18s;
        animation-delay: 4s;
      }

      &.el-4 {
        top: -50px;
        left: 50%;
        font-size: 24px;
        animation-duration: 14s;
        animation-delay: 1s;
      }

      &.el-5 {
        top: -50px;
        left: 65%;
        font-size: 20px;
        animation-duration: 16s;
        animation-delay: 3s;
      }

      &.el-6 {
        top: -50px;
        left: 75%;
        font-size: 36px;
        animation-duration: 20s;
        animation-delay: 0.5s;
      }

      &.el-7 {
        top: -50px;
        left: 15%;
        font-size: 32px;
        animation-duration: 13s;
        animation-delay: 6s;
      }

      &.el-8 {
        top: -50px;
        left: 40%;
        font-size: 28px;
        animation-duration: 22s;
        animation-delay: 2.5s;
      }

      &.el-9 {
        top: -50px;
        left: 60%;
        font-size: 34px;
        animation-duration: 17s;
        animation-delay: 5s;
      }

      &.el-10 {
        top: -50px;
        left: 85%;
        font-size: 38px;
        animation-duration: 19s;
        animation-delay: 1.5s;
      }
    }
  }
}

// 用户图标和锁图标
.user-icon {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300FFEA"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>') no-repeat center center;
}

.lock-icon {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300FFEA"><path d="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6z"/></svg>') no-repeat center center;
}

// 动画
@keyframes pulse {
  0% {
    opacity: 0.15;
    transform: translate(-50%, -50%) scale(0.9);
  }

  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes float-animation {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.3;
  }

  90% {
    opacity: 0.1;
  }

  100% {
    transform: translateY(1500px) rotate(15deg);
    opacity: 0;
  }
}

@keyframes grid-move {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 40px 0;
  }
}

@keyframes stars-move {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 200px 200px;
  }
}

@keyframes rain-fall {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 1000px;
  }
}

@keyframes scan-line {
  0% {
    top: -3px;
  }

  50% {
    top: 100%;
  }

  50.001% {
    top: -3px;
  }

  100% {
    top: -3px;
  }
}

@keyframes input-scan {
  0% {
    left: -10%;
  }

  100% {
    left: 110%;
  }
}

@keyframes ring-rotate {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes orbit-rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes btn-shine {
  0% {
    top: -100%;
    left: -100%;
  }

  100% {
    top: 100%;
    left: 100%;
  }
}

@keyframes seal-rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes beam-move {
  0% {
    transform: translateX(-50px) rotate(-45deg);
    opacity: 0.03;
  }

  100% {
    transform: translateX(50px) rotate(-45deg);
    opacity: 0.07;
  }
}

// 响应式调整
@media (max-width: 768px) {
  .register__card {
    padding: 30px 20px;
    margin: 0 20px;
  }

  .register__header .title {
    font-size: 32px;
  }

  .tech-effects .orbit {
    display: none;
  }
}

// 超小屏幕
@media (max-width: 480px) {
  .register__card {
    padding: 25px 15px;
  }

  .register__header .title {
    font-size: 28px;
  }

  .register__header .logo-container {
    width: 80px;
    height: 80px;
  }

  .register__form .register-btn {
    height: 50px;
    font-size: 16px;
  }

  .register__footer .cyber-seal {
    width: 60px;
    height: 60px;
  }
}
</style>
